import React, {useEffect, useState} from 'react';

function Index() {
    const [state,setState]=useState({count:0});
    useEffect(()=>{
        // setState({count: 115});
        document.title = `You clicked ${state.count} times`;
    // return function cleanup (){
    //     return
    // }
        },[state.count])
    return (
        <div>
            <p>You clicked {state.count} times</p>
            <button onClick={() => {
                let num=state.count+1;
                setState({count:num})
            }}>
                Click me
            </button>
        </div>
    );
}

export default Index;
